package com.huitian.net.core

import com.huitian.net.model.TargetWeekResult
import org.apache.commons.logging.Log
import org.apache.log4j.Logger
import org.apache.spark.sql.{DataFrame, Dataset, SparkSession}

trait Adapter extends Serializable {


  //get_dwd_saleinvoice_nc
  def get_dwd_saleinvoice_nc(spark:SparkSession, day: String,lastday:String, numPartition:Int, log: Logger):DataFrame


  //get_dwd_delivery_nc
  def get_dwd_delivery_nc(spark:SparkSession, day: String,lastday:String, numPartition:Int, log: Logger):DataFrame

  //spark的初始化：
  def session(): SparkSession

  //dws_delivery_in_salor_nc_w
  def get_dws_delivery_in_salor_nc_w(spark:SparkSession, day: String,lastday:String, numPartition:Int, log: Logger):DataFrame

  //==========================================================================================================
  //dwd_saleinvoice_nc
  def get_dwd_saleinvoice_nc_hive(spark:SparkSession, day: String,lastday:String, numPartition:Int, log: Logger)
//dws_saleinvoice_in_salor_nc_d
  def get_dws_saleinvoice_in_salor_nc_d_hive(spark:SparkSession, day: String,lastday:String, numPartition:Int, log: Logger)
  //dws_saleinvoice_in_salor_nc_m
  def get_dws_saleinvoice_in_salor_nc_m_hive(spark:SparkSession, day: String,lastday:String, numPartition:Int, log: Logger)
  //==========================================================================================================
  //dwd_delivery_nc
  def get_dwd_delivery_nc_hive(spark:SparkSession, day: String,lastday:String, numPartition:Int, log: Logger)
  //dws_delivery_in_salor_nc_d
  def dws_delivery_in_salor_nc_d_hive(spark:SparkSession, day: String,lastday:String, numPartition:Int, log: Logger)
  //dws_delivery_in_salor_nc_m
  def dws_delivery_in_salor_nc_m_hive(spark:SparkSession, day: String,lastday:String, numPartition:Int, log: Logger)

  def get_dws_delivery_in_salor_nc_d(spark:SparkSession, day: String,lastday:String, numPartition:Int, log: Logger):DataFrame

  def get_dws_delivery_in_salor_nc_m(spark:SparkSession, day: String,lastday:String, numPartition:Int, log: Logger):DataFrame
  //dws_delivery_in_industry_nc_d
  def get_dws_delivery_in_industry_nc_d(spark:SparkSession, day: String,lastday:String, numPartition:Int, log: Logger):DataFrame
  //dws_delivery_in_industry_nc_m
  def get_dws_delivery_in_industry_nc_m(spark:SparkSession, day: String,lastday:String, numPartition:Int, log: Logger):DataFrame

  def get_dws_saleinvoice_in_salor_nc_d(spark: SparkSession, day: String, lastday: String, numPartitions: Int, log: Logger):DataFrame

  //get_dws_saleinvoice_in_salor_nc_m
  def get_dws_saleinvoice_in_salor_nc_m(spark: SparkSession, day: String, lastday: String, numPartitions: Int, log: Logger):DataFrame

  //get_dws_saleinvoice_in_industry_nc_d
  def get_dws_saleinvoice_in_industry_nc_d(spark: SparkSession, day: String, lastday: String, numPartitions: Int, log: Logger):DataFrame

  //dws_saleinvoice_in_industry_nc_m
  def get_dws_saleinvoice_in_industry_nc_m(spark: SparkSession, day: String, lastday: String, numPartitions: Int, log: Logger):DataFrame

  //get_dwd_saleinvoice_custome_industry_nc_d
  def get_dwd_saleinvoice_custome_industry_nc_d(spark: SparkSession, day: String, lastday: String, numPartitions: Int, log: Logger):DataFrame

  //dws_saleinvoice_in_customer_nc_d
  def get_dws_saleinvoice_in_customer_nc_d(spark: SparkSession, day: String, lastday: String, numPartitions: Int, log: Logger):DataFrame

  //dws_saleinvoice_in_customer_nc_m
  def get_dws_saleinvoice_in_customer_nc_m(spark: SparkSession, day: String, lastday: String, numPartitions: Int, log: Logger):DataFrame




  //get_dws_tab_fhinfo_hb_nc
  def get_dws_tab_fhinfo_hb_nc_m(spark: SparkSession, day: String, lastday: String, numPartitions: Int, log: Logger):DataFrame

  //write2dws_tab_fhinfo_hb_nc
  def write2dws_tab_fhinfo_hb_nc_m(spark:SparkSession, day: String,lastday:String, ds:DataFrame, numPartition:Int, log: Logger)

  //dws_saleinvoice_in_customer_nc_d
  def write2dws_saleinvoice_in_customer_nc_d(spark:SparkSession, day: String,lastday:String, ds:DataFrame, numPartition:Int, log: Logger)

   //write2dws_saleinvoice_in_customer_nc_m
  def write2dws_saleinvoice_in_customer_nc_m(spark:SparkSession, day: String,lastday:String, ds:DataFrame, numPartition:Int, log: Logger)


  //write2dwd_saleinvoice_custome_industry_nc_d
  def write2dwd_saleinvoice_custome_industry_nc_d(spark:SparkSession, day: String,lastday:String, ds:DataFrame, numPartition:Int, log: Logger)


  //dws_saleinvoice_in_industry_nc_m
  def write2dws_saleinvoice_in_industry_nc_m(spark:SparkSession, day: String,lastday:String, ds:DataFrame, numPartition:Int, log: Logger)




  //write2dws_saleinvoice_in_industry_nc_d
  def write2dws_saleinvoice_in_industry_nc_d(spark:SparkSession, day: String,lastday:String, ds:DataFrame, numPartition:Int, log: Logger)

  //write2dwd_delivery_nc
  def write2dwd_delivery_nc(spark:SparkSession, day: String,lastday:String, ds:DataFrame, numPartition:Int, log: Logger)

  //write2dws_saleinvoice_in_salor_nc_m
  def write2dws_saleinvoice_in_salor_nc_m(spark:SparkSession, day: String,lastday:String, ds:DataFrame, numPartition:Int, log: Logger)


  //dws_delivery_in_salor_nc_w
  def write2dws_delivery_in_salor_nc_w(spark:SparkSession, day: String,lastday:String, ds:DataFrame, numPartition:Int, log: Logger)

  def write2dws_delivery_in_salor_nc_d(spark:SparkSession, day: String,lastday:String, ds:DataFrame, numPartition:Int, log: Logger)

  //dws_delivery_in_industry_nc_d
  def write2dws_delivery_in_industry_nc_d(spark:SparkSession, day: String,lastday:String, ds:DataFrame, numPartition:Int, log: Logger)

  //dws_delivery_in_industry_nc_m
  def write2dws_delivery_in_industry_nc_m(spark:SparkSession, day: String,lastday:String, ds:DataFrame, numPartition:Int, log: Logger)
  //dwd_saleinvoice_nc
  def write2dwd_saleinvoice_nc(spark:SparkSession, day: String,lastday:String, ds:DataFrame, numPartition:Int, log: Logger)

  def write2dws_delivery_in_salor_nc_m(spark:SparkSession, day: String,lastday:String, ds:DataFrame, numPartition:Int, log: Logger)
//write2dws_saleinvoice_in_salor_nc_d
 def write2dws_saleinvoice_in_salor_nc_d(spark:SparkSession, day: String,lastday:String, ds:DataFrame, numPartition:Int, log: Logger)


  //获取下个月第一天的数据
  def getNextMonth(day:String):String
  //获取下一日的数据：
  def getNextDay(day:String):String





}